<?php 
error_reporting(0);
require_once ('config.php'); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>添加好友</title>
<link href="global.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.message-box{
width:88%;
margin-top:6%;
}
body{
padding-bottom:20px;
}
label{
display:block;
text-align:center;
font-size:14px;
padding:5px;
margin:auto;
width:60px;
}
hr{
margin:8px;
}
.title-img{
height:25px;
width:auto;
margin-bottom:-10px;
}
.ex-btn{
display:inline-block;
padding:8px;
}
.container{
display:block;
width:100%;
}
.message-box .btn{
float:none;
margin:auto;
margin-top:15px;
margin-bottom:10px;
}
a{
color:#fe6565;
display:inline-block;
position:static;
}
#wexin-login-btn{
margin-bottom:10px;
}
.message-box .content{
max-height:none;
margin-bottom:5px;
margin-top:5px;
}
.circle-icon{
width:18px;
height:18px;
border-radius:9px;
background-color:#F0BEE0;
}
.circle-icon span{
color:white;
}
.hint-box{
font-size:small;
}
input{
text-align:center;
}
p{
font-size:14px;
}
a{
font-size:14px;
}
#area-select{
cursor:pointer;
width: 186px;
text-align: center;
color: #444;
background-color: #fff;
background-size: auto 15px;
padding: 8px;
border-radius: 8px;
border: 1px solid #ddd;
}
</style>
<?php
$sql1="select * from d_user where d_user_name='".$_SESSION['d_user']."'";
$rs1=mysql_fetch_array(mysql_query($sql1));
$sql="select * from d_user where d_user_id='".$_SESSION['d_user_id']."'";
$rs=mysql_fetch_array(mysql_query($sql));
?>
</head>
<html>
<body>
<div id="login-box" class="message-box" >
<header class="fruit-bg-header"></header>
<div class="content" >
	<section class="container" >
		<form action="" method="post" name="addfriends" onSubmit="return Checklogin();" style="margin-bottom:0px;">
			<label >ID</label>
			<input name="name" type="text" id="name" readonly="readonly" value="<?php echo $rs['d_user_id'];?>">
      		<label >昵称</label>
      		<input name="name" type="text" id="name" readonly="readonly" value="<?php echo $rs['d_user_nick'];?>"></br>
      		<input name="submit" type="submit" value="添加" class="btn" style="font-family: 微软雅黑"/>
      		<?php //echo $rs1['d_user_id']; ?>
		</form>
	<section class="container" >
<?php
if($_POST["submit"])
{	
	mysql_query($sql="insert into d_friends values('".$rs1['d_user_id']."','".$_SESSION['d_user_id']."')");
	echo "<script>alert('添加好友成功');location='member.php';</script>";
}
?>

<footer id="footer-bar" >
<div class="head-border" ></div>
<div class="btn-wrapper" >
<div class="btn-list" >
<li id="home-btn" data-id="home" ><a href='member.php'><img src="./img/home-icon.png" class="icon"/>个人中心</a></li>
<li id="home-btn" data-id="home" ><a href='my_friends.php'><img src="./img/order-icon.png" class="icon"/>我的好友</a></li>
<li id="home-btn" data-id="home" ><a href='my_programe.php'><img src="./img/order-icon.png" class="icon"/>我的项目</a></li>
<li id="home-btn" data-id="home" ><a href='my_supervise.php'><img src="./img/order-icon.png" class="icon"/>监督项目</a></li>

</div>
</div>
</footer>
</body>
</html>